package com.eee.machine.controller.web;


import com.eee.machine.common.MsgPushEntity;
import com.eee.machine.service.IOrderService;
import net.sf.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.concurrent.Callable;


@RestController
@RequestMapping("/web/order")
public class OrderManagerController {

    @Autowired
    private IOrderService orderService;

    @RequestMapping("/makeOrder")
    public Callable<JSONObject> makeOrder(@RequestBody MsgPushEntity msgPushEntity){
        return ()->{
            return orderService.makeOrder(msgPushEntity);
        };
    }
}
